package chapter04

import scala.collection.parallel.immutable

object Test04_Practice_Pyramid {
  def main(args: Array[String]): Unit = {
    for (i <- 1 to 9) {
      val stars = 2 * i - 1
      val spaces = 9 - i
      println(" " * spaces + "*" * stars)
    }


    //6、循环返回值
    val a: Unit = for (i <- 1 to 10) {
      i
    }
    println("a= " + a)


    // yield 变成链式集合
    val b = for (i <- 1 to 10) yield i
    println(b)

  }
}
